<!-- 收货成功 -->
<template>
	<view class="received">
		<image src="../../../static/images/user/received.png" mode="widthFix"></image>
		<view class="title">收货成功</view>
		<view class="tips">对商品做个评价吧~</view>
		<view class="btn_group">
			<view class="backHome" @click="backHome">逛逛首页</view>
			<view class="toEvaluate" @click="toEvaluate">评价商品</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: '',
			};
		},
		onLoad(option) {
			const orderId = option.orderId;
			if(orderId){
				this.id = orderId
			}else{
				this.$wanlshop.msg('非法进入页面')
				setTimeout(()=>{
					uni.switchTab({
						url: '/pages/index'
					})
				}, 1000)
			}
		},
		methods:{
			backHome() {
				/* uni.reLaunch({
					url: '/pages/user/order/order?state=4'
				}) */
				uni.switchTab({
					url: '/pages/index'
				})
			},
			toEvaluate(){
				this.$wanlshop.to(`/pages/user/order/evaluate?orderId=${this.id}&type=order`);
			}
		}
	}
</script>

<style lang="scss">
	.received {
		padding-top: 80rpx;
		color: $font-color-dark;
		font-size: 26rpx;
		display: flex;
		flex-direction: column;
		// justify-content: fe;
		align-items: center;

		image {
			width: 160rpx;
			height: 160rpx;
			margin-bottom: 30rpx;
		}

		.title {
			font-size: 32rpx;
			font-weight: bold;
			margin-bottom: 20rpx;
		}
		
		.tips{
			margin-bottom: 50rpx;
		}
		
		.btn_group{
			display: flex;
			gap: 50rpx;
			
			view{
				border: 2rpx solid $border-color-base;
				padding: 0 80rpx;
				height: 80rpx;
				border-radius: 10rpx;
				display: flex;
				justify-content: center;
				align-items: center;
			}
		}
	}
</style>